<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div{
            width: 300px;
            height: 300px;
            background: red;
            opacity: 0.3;
            filter: alpha(opacity:0.3);
            float: left;
            margin: 10px;
            cursor: pointer;
        }
    </style>
</head>
<body>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <script>
        var aDiv = document.getElementsByTagName('div');

        for(var i=0;i<aDiv.length;i++){
            aDiv[i].timer=null;
            aDiv[i].alpha = 30;
            aDiv[i].onmouseover = function () {
                startMove(this,100);
            }
            aDiv[i].onmouseout = function () {
                startMove(this,30);
            }
        }
        function startMove(obj,iTarget) {
            clearInterval(obj.timer);
            obj.timer = setInterval(function () {
               var speed = (iTarget-obj.alpha)/6;
               speed>0?Math.ceil(speed):Math.floor(speed);


               if(iTarget ==obj.alpha){
                   clearInterval(obj.timer);
               }
               else {
                   obj.alpha+=speed
                   obj.style.opacity = obj.alpha/100;
                   obj.style.filter = 'filter(opacity:'+obj.alpha+')';

               }

            },30)

        }
        
        
        
        
        
    </script>
</body>
</html>